package com.kintreda.ieco_server.bean.account;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.kintreda.ieco_server.util.DateUtil;
import com.kintreda.ieco_server.util.StringUtil;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/***
 * 组织机构
 */
@Entity
@Table(name = "organization")
public class Organization implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    private String id = UUID.randomUUID().toString().replace("-", "");//编号
    private String name;//组织机构名称
    private String code = StringUtil.getRandomAndTimestamp(4).toUpperCase();//邀请码
    private String pid = "";//父节点
    private String orgid;//所属机构
    private Integer status = 0;//0正常 1已删除
    private Integer orgStatus = 0;// 0机构下级(不需要申请) 1申请中 2申请通过 3不通过
    private String address;
    private String icon;//图标
    private String type;//1 幼儿园 2小学 3 初中 4 高中 5 大学 6国企 7民企 8外企 9政府 10公益 11社团 12个人
    private String nature;//性质 0 机构 1 子机构
    private String latitude;//纬度
    private String longitude;//经度
    private String invoice;//发票抬头
    private String ein;//税号
    private String administrator;//管理员
    private String adminName;//管理员名字
    private String administratorTel;//管理员电话
    private String financial;//财务
    private String financialTel;//财务电话
    private String number;//人数
    private String adminId="";//管理员Id
    private Integer allow=0;//允许下级成员提现  0不允许 1允许

    @Column(name = "createDate")
    private String createDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
    @Column(name = "updateDate")
    private String updateDate = DateUtil.getDate(DateUtil.YYYY_MM_DD_HH_MM_SS);
    //------------------------临时变量------------------------------
    @Transient
    @JsonIgnore
    private List<Menu> children = new ArrayList<Menu>();

    @Transient
    private String num;//可用袋子

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Column
    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    @Column
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    public String getOrgid() {
        return orgid;
    }

    public void setOrgid(String orgid) {
        this.orgid = orgid;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getInvoice() {
        return invoice;
    }

    public void setInvoice(String invoice) {
        this.invoice = invoice;
    }

    public String getEin() {
        return ein;
    }

    public void setEin(String ein) {
        this.ein = ein;
    }

    public String getAdministrator() {
        return administrator;
    }

    public void setAdministrator(String administrator) {
        this.administrator = administrator;
    }

    public String getAdministratorTel() {
        return administratorTel;
    }

    public void setAdministratorTel(String administratorTel) {
        this.administratorTel = administratorTel;
    }

    public String getFinancial() {
        return financial;
    }

    public void setFinancial(String financial) {
        this.financial = financial;
    }

    public String getFinancialTel() {
        return financialTel;
    }

    public void setFinancialTel(String financialTel) {
        this.financialTel = financialTel;
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public Integer getOrgStatus() {
        return orgStatus;
    }

    public void setOrgStatus(Integer orgStatus) {
        this.orgStatus = orgStatus;
    }

    public String getAdminId() {
        return adminId;
    }

    public void setAdminId(String adminId) {
        this.adminId = adminId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getAllow() {
        return allow;
    }

    public void setAllow(Integer allow) {
        this.allow = allow;
    }

    public String getNature() {
        return nature;
    }

    public void setNature(String nature) {
        this.nature = nature;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }
}
